#ifndef SEARCHDEVICEWIN_H
#define SEARCHDEVICEWIN_H

#include <QWidget>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QLabel>
#include <QListWidget>
#include <QStackedWidget>

#include "searchdeviceitem.h"
#include "adddeviceitem.h"
#include "util.h"
#include "loadanimation.h"
#include "devicecodewidget.h"
#include "publicattributes.hpp"
#include "levitationbutton.h"

class SearchDeviceWin : public QWidget
{
    Q_OBJECT
public:
    explicit SearchDeviceWin(QWidget *parent = nullptr);
    ~SearchDeviceWin();

    void setTheme(PublicAttributes::Theme theme);

    void setItemInfo(const QMap<QString, KMobileCommon::DiscoveryDeviceInfo> &map);

    void showLoad();

    void setSearchBtnState(bool isShow);

    void moveSearchBtn();

Q_SIGNALS:
    void sigItemInfo(QString);
    void sigContinueSearch();
    void sigInitDeviceFinish();
    void sigDeviceCode(QString);

private:
    void initUI();
    void initSearchButton();

private:
    QListWidget *m_listWidget = nullptr;

    AddDeviceItem *m_continueSearchDeviceItem = nullptr;
    LoadAnimation *m_loadAnimation = nullptr;
    QStackedWidget *m_stackedWidget = nullptr;
    LevitationButton *m_searchBtn = nullptr;
    bool isShowSearchBtn = false;
    bool isSearchInitFinish = false;

Q_SIGNALS:
};

#endif // SEARCHDEVICEWIN_H
